#!/bin/bash
HTTP_PING=/export/scripts/httping
DATE_S=`date +%s`
LOCKFILE=/tmp/lockfile

if [ -e $LOCKFILE ]; then
        echo "Erro: Lockfile $LOCKFILE existe"
        exit 1
fi
touch $LOCKFILE


	VIRGULA=`$HTTP_PING -c 5 http://virgula.uol.com.br|awk -F/ '/round-trip/{print "virgula", $5}'|sed -e 's/ms//g'`

	VAGALUME=`$HTTP_PING -c 5 http://vagalume.uol.com.br|awk -F/ '/round-trip/{print "vagalume", $5}'|sed -e 's/ms//g'`

	VIDEOLOG=`$HTTP_PING -c 5 http://videolog.uol.com.br|awk -F/ '/round-trip/{print "videolog", $5}'|sed -e 's/ms//g'`

echo $DATE_S `hostname` varnish: UOLGRAPH varnish 5 zadmin2 AGENTE_LASTRUN $DATE_S $VIRGULA $VAGALUME $VIDEOLOG | logger -p local5.info -t UOL007

rm $LOCKFILE
